package com.example.teesystem.mapper;

import com.example.teesystem.entity.ClassStudent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 28131
* @description 针对表【t_class_student】的数据库操作Mapper
* @createDate 2022-03-30 13:50:39
* @Entity com.example.teesystem.entity.ClassStudent
*/
@Mapper
public interface ClassStudentMapper extends BaseMapper<ClassStudent> {
    @Select("select id from t_class_student where class_id = #{classId} and student_id = #{studentId} and is_delete = 0")
    int getIdByMessage(Integer studentId,Integer classId);

    @Select("select student_id from t_class_student where class_id = #{classId} and is_delete = 0")
    List<Integer> getStudentIdByClassId(Integer classId);

    @Select("select class_id from t_class_student where student_id = #{studentId} and is_delete = 0")
    List<Integer> getClassIdByStudentId(Integer studentId);
}




